﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PersonEmpCertAmend.aspx.cs"
    Inherits="RN.ERP.Web.Person.PersonEmpCertAmend" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>
        <%=PageTitle %></title>
    <link href="../Styles/skins/blue/css/style.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/skins/blue/css/style_msg.css" rel="stylesheet" type="text/css" />
    <link rel="Stylesheet" type="text/css" href="../Scripts/ligerUI/skins/Aqua/css/ligerui-all.css" />
    <script src="../Scripts/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript" src="../Scripts/json-data.js"></script>
    <script type="text/javascript" src="../Scripts/iepngfix_tilebg.js"></script>
    <script src="../My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script type="text/javascript" src="../Scripts/ligerUI/js/ligerui.min.js"></script>
    <script src="../Scripts/PsnEmpInfoSelect.js" type="text/javascript"></script>
    <style type="text/css">
        .IE6png
        {
            behavior: url("../Scripts/iepngfix.htc");
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <input id="hdEducationGUID" type="hidden" runat="server" value="" />
    <input id="hdEmpGuid" type="hidden" runat="server" value="" />
    <input id="hdStatus" type="hidden" runat="server" value="0" />
    <input id="hdAreaCode" type="hidden" runat="server" value="" />
    <input type="hidden" id="hdCorpGuid" runat="server" value="" />
    <table width="600" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
            <td width="16" class="title_lbg IE6png">
            </td>
            <td width="24" class="title_t IE6png">
            </td>
            <td width="543" class="title_libg IE6png">
                建设类执业注册证书
            </td>
            <td width="17" class="title_rbg IE6png">
            </td>
        </tr>
        <tr>
            <td class="border_lbg IE6png">
                &nbsp;
            </td>
            <td colspan="2">
                <div id="con">
                    <ul id="tags">
                        <li class="selectTag"><a href="javascript:void(0)">建设类执业注册证书</a> </li>
                    </ul>
                    <div id="tagContent">
                        <div class="tagContent selectTag" id="empTitleDetails" table="tb_emp_titledetails"
                            valtype="1">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="xx_tab">
                                <tr>
                                    <td align="left" colspan="2">
                                        本功能适用于联网获取信息有误的情况，人员信息上报后本内容将不可修改
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <input id="cb1" type="checkbox" control="" />本人无此项注册资格
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <input id="cb2" type="checkbox" control=""/>本人存在此项注册资格信息有误 (请输入有误信息)
                                        <br />
                                        <textarea id="txtRemark" rows="5" maxlength="50" style="width: 400px; height: 80px" control=""></textarea>
                                        
                                    </td>
                                </tr>
                            </table>
                            <table height="80" border="0" align="center" cellpadding="0" cellspacing="0" runat="server"
                                id="btnSaveDiv" class="xx_tab">
                                <tr>
                                    <td width="64" height="80">
                                        <div class="icon01 IE6png">
                                            <a id="btnSave" parentdiv="empTitleDetails" href="javascript:void(0);">保存</a></div>
                                    </td>
                                    <td width="11" height="80">
                                        &nbsp;
                                    </td>
                                    <td width="64" height="80">
                                        <div class="icon02 IE6png">
                                            <a id="btnCancel" href="javascript:void(0);">关闭</a></div>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </div>
            </td>
            <td class="border_rbg IE6png">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="border_lconer IE6png" headers="17">
                &nbsp;
            </td>
            <td colspan="2" class="border_bottomli IE6png" height="17">
                &nbsp;
            </td>
            <td class="border_rconer IE6png" headers="17">
                &nbsp;
            </td>
        </tr>
    </table>
   
    </form>
</body>
</html>
<script type="text/javascript">
    var empGuid;
    var status;
    var educationGUID;
    var editStatus;
    var cartGuid;
    $(function () {
       
        empGuid = $("#<%= hdEmpGuid.ClientID%>").val();
        status = $("#<%= hdStatus.ClientID%>").val();
        educationGUID = $("#<%= hdEducationGUID.ClientID%>").val();
        editStatus = "<%=EditStatus %>";
        cartGuid = $("#<%=hdEducationGUID.ClientID %>").val();
        Initial();
        SetControlEditById(editStatus, "empTitleDetails"); //控件编辑状态设置
    });
    /*初始化页面*/
    function Initial() {
        descr = "";
        $("#btnSave").click(function () {
            EmpTitleDetailsSave();
        });
        $("#btnCancel").click(function () {
            closeChildWin();
        });      
        if (status == "1") {
            GetQualities();
        }
        $("#cb1").click(function () {
            checkChk(this);
        });
        $("#cb2").click(function () {
            checkChk(this);
        });
    }
    function checkChk(chk) {
        var flag = "0";
        if ($(chk).attr("checked")) {
            flag = "1";
            $("input[type='checkbox']").each(function () {
                $(this).removeAttr("checked");
            });
        }
        if (flag == "1") {
            $(chk).attr("checked", "true");
        }
        $("#txtRemark").val("");
    }
    /*取得信息**/
    function GetQualities() {
        $.getJSON("PersonEmpCertInfo.aspx", { "action": "GetQualities", "empGuid": empGuid, "certGuid": educationGUID, "rand": Math.random() }, function (data) {
            if (data.length == 0 || data == null) {
                OpenAlert("未查询到有效数据！");
                return false;
            }
            if (data.result == 1) {
                OpenAlert(data.message);
                return false;
            }
            var items = data.data;
            if (items != null) {
                var remark = items.Remark;
                if (remark != null && remark.length >= 1) {
                    var cb = remark.substring(0, 1);
                    if (cb == "0") {
                        $("#cb1").attr("checked", "true");
                    } else if (cb == "1") {
                        $("#cb2").attr("checked", "true");
                        $("#txtRemark").val(remark.replace("1,", ""));
                    }
                   
                }
            }
        });
    }

    /*关闭窗口*/
    function closeChildWin() {
        returnToParent(0);
        CloseClildWorkExpWin();
    }
    function returnToParent(result) {
        var oArg = new Object();
        oArg.childWinName = "Cert"; //资格证书
        oArg.Result = result;
        parent.window.OnClientClose(oArg);
    }
    function CloseClildWorkExpWin() {
        window.parent.$.ligerDialog.close(); ////关闭dialog
        parent.$(".l-dialog,.l-window-mask").hide(); ////去除父窗体遮罩层
        parent.window.focus(); //返回焦点
    }
   
    function OpenAlert(text) {
        $.ligerDialog.warn(text);
        return false;
    }
    function OpenConfirm(text, confirmCallBackFn) {
        $.ligerDialog.confirm(text, '', confirmCallBackFn);
        return false;
    }
</script>
<script type="text/javascript">
    //审核
    function EmpTitleDetailsSave() {          
        if ($("#cb2").attr("checked")) {
            if ($("#txtRemark").val() == "") {
                OpenAlert("请输入有误信息！");
                $("#txtRemark").focus();
                return false;
            }
            if ($("#txtRemark").val().length > 50) {
                OpenAlert("有误信息内容过长！");
                $("#txtRemark").select();
                return false;
            }
        }
        confirmCallBackFnAudit();
        return false;

    }
    //审核执行事件
    function confirmCallBackFnAudit() {
        var cb = "";
        if ($("#cb1").attr("checked")) {
            cb = "0";
        }
        if ($("#cb2").attr("checked")) {
            cb = "1";
        }
        var parmer = {};
        parmer.action = "editRemark";
        parmer.empGuid = empGuid;
        parmer.certGuid = cartGuid;
        if (cb == "1") {
            parmer.remark = cb + "," + $("#txtRemark").val();
        }
        if (cb == "0") {
            parmer.remark = cb;
        }
        parmer.rand = Math.random();

        $.getJSON("PersonEmpCertAmend.aspx", parmer, function (data) {
            OpenAlert(data.Message);
            if (data.Result) {
                returnToParent(0);
            }
        });
    }
   
</script>
